/*Copyright (C) 2013-2021 LZE*/
#include<bits/stdc++.h>
#define INF 0x7fffffff
using namespace std;
typedef long long ll;
ll n,p;
inline int rd() {
	int x=0;bool ntv=false;char c=getchar();
	while((c<'0'||c>'9')&&c!='-')c=getchar();if(c=='-')ntv=true;else x=(c^48);c=getchar();
	while(c>='0'&&c<='9') {x=x*10+(c^48);c=getchar();}return ntv?-x:x;
}
ll fast_pow(ll base,ll power,ll modnum){
	ll ans=1;
	while(power>0){
		if(power&1)ans=ans*base%modnum;
		power>>=1;
		base=base*base%modnum;
	}
	return ans%modnum;
}
int main() {
	scanf("%lld%lld",&n,&p);
	for(int i=1;i<=n;i++){
		cout<<fast_pow(i,p-2,p)<<endl;
	}
	return 0;
}